
/******************************************************************************\
|    Title:        	 TABLE E9: Placebo Regressions for Becoming Lobbyist	   |
|    Date:         	 July 2023	                                         	   |
|    Author:         Elisa Wirsching	      							       |
\******************************************************************************/


clear all
set more off, permanently
numlabel, add
set maxvar 32000

use congress_yearly.dta, clear
xtset stafferid year


xtreg lobbydirectafter switchtouncovered_treatment i.year if posttreat==0 & year!=2007, fe nonest cluster(stafferid) 
summarize lobbydirectafter if e(sample)==1
estadd scalar ymean = r(mean) 
est store model1
estadd local fixed "Yes" , replace

xtreg lobbydirectafter switchtouncovered_treatment daysworked committeestaff_everyear personalstaff_everyear senate_everyear majority_everyear minority_everyear ///
	dcoffice_everyear leaderofficestaff_everyear i.year if posttreat==0 & year!=2007, fe nonest cluster(stafferid) 
summarize lobbydirectafter if e(sample)==1
estadd scalar ymean = r(mean)
est store model2
estadd local fixed "Yes" , replace

	
xtreg lobbydirectafter switchtouncovered_treatment daysworked experience_imp experience_sq committeestaff_everyear personalstaff_everyear senate_everyear majority_everyear minority_everyear ///
	dcoffice_everyear leaderofficestaff_everyear i.year if posttreat==0 & year!=2007, fe nonest cluster(stafferid) 
summarize lobbydirectafter if e(sample)==1
estadd scalar ymean = r(mean) 
est store model3
estadd local fixed "Yes" , replace


esttab model* using "TABLED9.csv", replace ///
	b(3) se(3) star(* .05 ** .01 *** 0.001) ///
	stats(fixed ymean N N_g r2, fmt(0 3 0 0 3) labels("Staffer FE" "Mean of DV"  "Observations" "Number of staffers" "R2"))  ///
	nomtitles mgroups("2001-2007" "2001-2006", pattern(1 0 0 1 0 0)) ///
	coeflabels(switchtouncovered_treatment "Switch to uncovered" daysworked "Days worked" experience_imp "Hill experience" experience_sq "Hill experience sq." committeestaff2_everyear "Committee staff" personalstaff_everyear "Personal staff" senate_everyear "Senate staff" majority_everyear "Majority party staff" minority_everyear "Minority party staff" dcoffice_everyear "DC office staff" leaderofficestaff_everyear "Leadership office staff") ///
    label parentheses nogaps nolines noeqlines ///
    noomitted nodepvars nobaselevels indicate("Year FE = *.year") nonotes noconstant